#ifndef __HAL__
#define __HAL__

#include "../lib/def.h"

BYTE READ_PORT_BYTE(PBYTE pbPort);
WORD READ_PORT_WORD(PWORD pwPort);
DWORD READ_PORT_DWORD(PDWORD pdwPort);

VOID WRITE_PORT_BYTE(PBYTE pbPort, BYTE bValue);
VOID WRITE_PORT_WORD(PWORD pwPort, WORD wValue);
VOID WRITE_PORT_DWORD(PDWORD pdwPort, DWORD dwValue);

DWORD HalPciReadIoConfigByte(DWORD dwAddress, PBYTE pbResult, BYTE bOffset);
DWORD HalPciReadIoConfigWord(DWORD dwAddress, PWORD pwResult, BYTE bOffset);
DWORD HalPciReadIoConfigDword(DWORD dwAddress, PDWORD pdwResult, BYTE bOffset);

DWORD HalPciWriteIoConfigByte(DWORD dwAddress, BYTE bValue, BYTE bOffset);
DWORD HalPciWriteIoConfigWord(DWORD dwAddress, WORD wValue, BYTE bOffset);
DWORD HalPciWriteIoConfigDword(DWORD dwAddress, DWORD dwValue, BYTE bOffset);

DWORD HalPciReadMmConfigByte(DWORD_PTR dwAddress, PBYTE pbResult, BYTE bOffset);
DWORD HalPciReadMmConfigWord(DWORD_PTR dwAddress, PWORD pwResult, BYTE bOffset);
DWORD HalPciReadMmConfigDword(DWORD_PTR dwAddress, PDWORD pdwResult, BYTE bOffset);

DWORD HalPciWriteMmConfigByte(DWORD_PTR dwAddress, BYTE bValue, BYTE bOffset);
DWORD HalPciWriteMmConfigWord(DWORD_PTR dwAddress, WORD wValue, BYTE bOffset);
DWORD HalPciWriteMmConfigDword(DWORD_PTR dwAddress, DWORD dwValue, BYTE bOffset);

#endif